package mlz.a_oop;

//导入 其他包下对应的类,
import mlz.e_work.Movie;

//需求: 需要处理学生的信息: 学生的姓名、语文、数学，要求打印出学生的总成绩和平均成绩
public class Demo01Test {
    public static void main(String[] args) {
        //面向对象 --> 对象
        Student stu1 = new Student();
        stu1.name = "张三";
        stu1.chinese = 99;
        stu1.math = 65;
        stu1.printSumScore();
        stu1.printAvgScore();

        Student stu2 = new Student();
        stu2.name = "李四";
        stu2.chinese = 90;
        stu2.math = 69;
        stu2.printSumScore();
        stu2.printAvgScore();


        System.out.println("-------------------------------");

        //面向过程
        printAvgScore("张三",100,95.5);
        printAvgScore("李四",85.5,95.5);

        printSumScore("张三",100,95.5);


        //使用e_work中的Movie这个类
        //Movie movie = new Movie();

    }

    //求总成绩
    public static void printSumScore(String name,double chinese, double math){
        System.out.println(name + "同学的总成绩:" + (chinese + math));
    }

    //求平均成绩
    public static void printAvgScore(String name,double chinese, double math){
        System.out.println(name + "同学的平均成绩:" + (chinese + math) / 2.0);
    }
}














